﻿@model IEnumerable<Gagnatek.WebSite.Models.Loans>

@{
    ViewBag.Title = "Index";
}


<p>
    @Html.ActionLink("Nouvel emprunt", "Create")
</p>
<table>
    <tr>
        <th>
            Date d'emprunt
        </th>
        <th>
            Date de retour
        </th>
        <th>
            Utilisateur
        </th>
        <th>
            Média
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.pickedAt)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.returnedAt)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Users.email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Medias.name)
        </td>
        <td>
            @Html.ActionLink("Editer", "Edit", new { id=item.id }) |
            @Html.ActionLink("Details", "Details", new { id=item.id }) |
            @Html.ActionLink("Supprimer", "Delete", new { id=item.id })
        </td>
    </tr>
}

</table>
